using B.S.Medical.Api.Read.Application.Command.Doctor;
using B.S.Medical.Api.Read.DTOS;
using B.S.Medical.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;

namespace B.S.Medical.Api.Read.Controllers.Doctor
{
    /// <summary>
    /// 医生职称控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class JobTitleController : ControllerBase
    {
        private readonly IMediator _mediator;
        private readonly ILogger<JobTitleController> _logger;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="mediator">中介者</param>
        /// <param name="logger">日志记录器</param>
        public JobTitleController(IMediator mediator, ILogger<JobTitleController> logger)
        {
            _mediator = mediator;
            _logger = logger;
        }

        /// <summary>
        /// 获取职称详情
        /// </summary>
        /// <returns>职称详情</returns>
        [HttpGet]
        public Task<ApiResult<List<JobTitleDTO>>> GetJobTitle([FromQuery]GetJobTitleCommand request)
        {
            return _mediator.Send(request);
        }
    }
}